package org.jssvc.opac.data

import android.content.Context
import org.jssvc.opac.R
import org.jssvc.opac.bean.BookStore
import org.jssvc.opac.bean.Content

object DataFormatUtils {

    // 获取图书基本信息
    fun getBookIntro(context: Context, boonBean: Content): String {
        var intro = ""
        intro += context.getString(R.string.book_details_title) + context.getString(
            R.string.book_symbol,
            boonBean?.title
        )
        intro += "\n" + context.getString(R.string.book_details_author) + boonBean?.author
        intro += "\n" + context.getString(R.string.book_details_publisher) + boonBean?.publisher
        return intro
    }

    // 获取库存信息
    fun getBookStoreIntro(list: List<BookStore>): String {
        var intro = "\n"
        list.forEach {
            intro += "░░ | " + it.barCode + "\n░░ | " + it.place + "\n░░ | " + it.state + "\n\n"
        }
        return intro
    }
}